package com.macro.mall.dao;

import com.macro.mall.bean.entity.OdrOrderPay;
import com.macro.mall.mapper.OdrOrderPayMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class OdrOrderPayDao {

    @Autowired
    OdrOrderPayMapper mapper;

    public OdrOrderPay selectByPrimaryKey(String payNo) {
        return mapper.selectByPrimaryKey(payNo);
    }

    public List<OdrOrderPay> listByModel(OdrOrderPay model) {
        return mapper.select(model);
    }

    public int insert(OdrOrderPay model) {
        return mapper.insertSelective(model);
    }

    public int update(OdrOrderPay model) {
        return mapper.updateByPrimaryKeySelective(model);
    }

    public int deleteByPayNo(String payNo) {
        return mapper.deleteByPrimaryKey(payNo);
    }

    public int batchInsert(List<OdrOrderPay> odrOrderPayList){
        return mapper.insertList(odrOrderPayList);
    }
    public OdrOrderPay selectByOrderId(@Param("orderId") String orderId) {
        return mapper.selectByOrderId(orderId);
    }


}
